package com.cykj.user.controller;

import com.cykj.common.dto.ResponseDTO;
import com.cykj.user.service.ICollectService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject: smart_recruit_backend
 * @BelongsPackage: com.cykj.user.controller
 * @Author: 浮行
 * @CreateTime: 2025-08-25 19:49
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("/collect")
public class CollectController {
    @Autowired
    private ICollectService collectService;
    @GetMapping("/select")
    @Operation(summary = "通过用户Id获取收藏职位信息")
    @Parameters({
            @Parameter(name = "userId",description = "用户id",required = true,in = ParameterIn.QUERY)
    })
    public ResponseDTO select(@RequestParam("userId") Integer userId){
        return collectService.selectCollectList(userId);
    }
    @DeleteMapping("/delete/{collectionId}")
    @Operation(summary = "通过收藏列表id删除对应的收藏")
    @Parameters({
            @Parameter(name = "collectionId",description = "收藏列表id",required = true,in = ParameterIn.QUERY)
    })
    public ResponseDTO delete(@PathVariable("collectionId") Integer collectionId){
        return collectService.deleteCollect(collectionId);
    }
}
